package cn.edu.xmu.oomall.order.microservice;

import cn.edu.xmu.oomall.core.config.OpenFeignConfig;
import cn.edu.xmu.oomall.order.microservice.bo.Refund;
import cn.edu.xmu.privilegegateway.annotation.util.InternalReturnObject;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "payment-service", configuration = OpenFeignConfig.class)
public interface PaymentService {

    /** 查询自己订单的支付信息 **/
    @GetMapping("orders/{id}/payment")
    InternalReturnObject getOrderPayments(@PathVariable Long id);


    /** 新建退款 **/
    @PostMapping("internal/payment/refundInsert")
    InternalReturnObject insertRefund(@RequestParam Refund refund);

}
